<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>
           	 卷云户外 - 我的收藏
        </title>
        <jsp:include page="personcommonref.jsp"></jsp:include>
    </head>
    <body id="user">
        <div class="user_cover_bg"></div><!--user box begin-->
        <div class="user_box">
        	<%--	公共头部	 --%>
			<jsp:include page="indexHead.jsp" ></jsp:include>
			
			<%--	个人信息公共	begin --%>
			<!--banner begin-->
			<div class="banner_box">
			    <img src="../images/user_banner1.jpg" />
			</div>
			<!--banner end-->
			
			<div class="user_info_box clearfix">
				<div class="user_box_lt">
			    <div class="user_box_lt_bg"></div>
			    <div class="user_box_lt_cont">
			        <div class="user_box_lt_top">
			            <div class="user_box_lt_header">
			                <img src="${session.user.headImg }">
			                <h4>
			                	${session.user.nickName}
			                    <c:if test="${session.user.sex==1}">
			                		<img src="../images/user_focus_b.png">
			                	</c:if>
			                    <c:if test="${session.user.sex==0}">
			                		<img src="../images/user_focus_g.png">
			                	</c:if>
			                </h4>
			            </div>
			
			        </div>
			        <ul>
			            <li ><a href="personinfo.jsp">我的个人资料</a></li>
			            <li><a href="PostAction_personPost.action">我的发帖</a></li>
			            <li><a href="ReplyAction_personReply.action">我的回复</a></li>
			            <li class="user_left_current"><a href="UserAction_personCollect.action">我的收藏</a></li>
			            <li><a href="personfocus.jsp">我的关注</a></li>
			            <li><a href="personmsglist.jsp">我的消息</a></li>
			            <li><a href="personhome.jsp">我的主页</a></li>
			        </ul>
			    </div>
			</div>
			<link type="text/css" href="../css/personinfo/setup.css" rel="stylesheet">
			<script type="text/javascript" src="../js/personinfo/select.js"></script>
			<%--	个人信息公共	end  --%>
        
                <div class="user_box_rg">
                    <div class="user_community">
                        <!-- <div class="user_commu_form_title">
                            <ul class="tab">
                                <li class="current">
                                    <a>我发布的帖子</a>
                                </li>
                            </ul>
                        </div> -->
                        <c:if test="${fn:length(page.queryResult) == 0 }">
                        	<div style="font-size: 16px;color:#666;line-height: 30px;text-align: center;">
                        		<p>您还没有收藏记录噢~</p>
                        	</div>
                        </c:if>
                        <c:if test="${fn:length(page.queryResult) > 0 }">
                        <div class="user_comm_form">
                            <table cellspacing="0" cellpadding="0" border="0" id="content">
                                <tbody>
                                    <tr>
                                        <td>
                                            帖子
                                        </td>
                                        <td>
               	发布人                             
                                        </td>
                                        <td>
                                            查看/回复
                                        </td>
                                        <td></td>
                                    </tr>
                                    <c:forEach items="${page.queryResult }" var="post">
                                    <tr>
                                        <td>
                                            <a href="ReplyAction_singlePost.action?pid=${post.id }&pagenum=1">${post.title }</a>
                                        </td>
                                        <td>
                                            ${post.nickName }
                                        </td>
                                        <td>
                                            <span>${post.viewNumber }/${post.replyNumber }</span>
                                        </td>
                                        <td>
                                            <a id="${post.id }" onclick="cancelCollect(this.id)" href="javascript:void(0)">取消收藏</a>
                                        </td>
                                    </tr>
                                    </c:forEach>
                                    <tr>
										<td colspan="4">
											<a href="UserAction_personCollect.action?pagenum=1" >首页</a>
								    		<c:if test="${page.currentPageNo>1 }">
								    			<a href="UserAction_personCollect.action?pagenum=${page.currentPageNo-1 }" >上一页</a>
								    		</c:if>
								    		<c:if test="${page.currentPageNo<page.pageCount }">
								    			<a href="UserAction_personCollect.action?pagenum=${page.currentPageNo+1 }" >下一页</a>
								    		</c:if>
								    		<a href="UserAction_personCollect.action?pagenum=${page.pageCount }">末页</a>
								    		<span>当前第<span style="color: #37B8EB"> ${page.currentPageNo } </span> 页</span>
								    		<span>总页数:<span style="color: #37B8EB">${page.pageCount }</span></span>
										</td>                                    
                                    </tr>
                                </tbody>
                            </table>
                            <div class="user_comm_more">
                                <input type="hidden" name="uid" value="1272616" id="uid"><input type="hidden" name="page" value="1" id="page">
                            </div>
                        </div>
                        </c:if>
                    </div>
                </div><!-- footer end-->
                <script type="text/javascript">
                
                function cancelCollect(pid){
                	var url = "UserAction_cancelCollect";
                	if(confirm("确定要取消收藏吗？")){
                		location.href = url+"?pid="+pid;
                	}
                }
                
				jQuery.ready(function(){
                jQuery(".user_order_info").hover(function(){
                jQuery(this).css("border","1px solid #f1a400");
                },function(){
                jQuery(this).css("border","1px solid #fff");
                });

                jQuery("#more").click(function(){
                jQuery.get('/home/morethread?page='+jQuery("#page").val()+'&uid='+jQuery("#uid").val(),function(data){
                jQuery("#page").val(data.page);
                if(data.more == '2'){
                    jQuery("#more").html('没有更多了').unbind();
                }
                var html = '';
                jQuery.each(data.threads, function(infos, info){
                    if(info.subject) {
                        html += '<tr><td><a href="'+info.url
                                +'">'+info.subject.substring(0,16)
                                +'<\/a><\/td><td>'+info.views
                                +'/'+info.replies
                                +'<\/td><td>'+info.lastposter
                                +'<span>('+info.timeTran
                                +')<\/span><\/td><td><a href="'+info.url
                                +'">编辑<\/a><\/td><\/tr>';
                    }
                });
                jQuery("#content").append(html);

                });
                });
                })
                </script>
            </div>
        </div><!--user box end-->
        
        <%--	公共底部	 --%>
		<jsp:include page="indexFooter.jsp" />
		
    </body>
</html>
